1. Field of the Invention
The present invention relates to a terminal printer which, in a system wherein a plurality of host devices and the terminal printer are connected to each other via an interface configured by a single line, can receive one or more packetized data transmitted from the plurality of host devices.
2. Description of the Related Art
Conventionally, printers comprising a plurality of input buffers which temporarily hold data received via an interface, and having a plurality of print modes which can be arbitrarily switched over, such as a character mode, a bit image mode and so on, have been proposed.
For example, Japanese Unexamined Patent Publication JP-A 5-338278 (1993) discloses a printer comprising: a temporary buffer which is equal in capacity to the largest one of the plurality of input buffers; structure for changing an input pointer for managing an input of the input buffers, onto one of the plurality of input buffers; structure for transferring contents of an input buffer which is selected by the input pointer designated before a change of the input pointer, to the temporary buffer; structure for changing an output pointer for managing an output of the input buffers, onto the temporary buffer; and structure for, at a timing when the temporary buffer becomes empty, changing the output pointer onto an input buffer designated as a result of the change of the input pointer. According to this configuration, for each print mode, the position and size of the input buffer can be set arbitrarily and in real time.
At least one of the input buffers is set to have a size in the unit of 1 byte or 256 bytes, so that a reception buffer used in the character mode can be used for another purpose as it is. When the buffer is used as a print buffer, for example, the printout of a bit image can be further accelerated. Furthermore, the means for transferring contents of an input buffer designated before a change of the input pointer to the temporary buffer, and the means for transferring contents of the temporary buffer to the input buffer designated after the change of the input pointer are realized by hardware. As a result, the hardware serving as the temporary buffer is configured as a detachable cartridge.
Japanese Unexamined Patent Publication JP-A 5-341926 (1993) discloses a printer comprising: structure for, at a timing when a mode is switched over, stopping data reception; structure for, at a timing when an input buffer becomes empty, changing a pointer for managing an input/output of the input buffer; and structure for restarting data reception, wherein for each print mode, the position and capacity of the input buffer can be arbitrarily set.
Furthermore, the capacity of the input buffer in at least one mode is set to be in the unit of 1 byte or 256 bytes, so that the capacity of a reception buffer used in the character mode can be used for another purpose as it is. When the buffer is used as a print buffer, for example, the printout of a bit image can be further accelerated. Moreover, the input buffer in at least one mode is configured so as to be incorporated into a detachable cartridge.
Japanese Unexamined Patent Publication JP-A 5-341927 (1993) discloses a printer comprising: structure for, at a timing when a mode is switched over, stopping data reception; structure for changing an input pointer for managing an input of input buffers, onto one of the plurality of input buffers; structure for restarting data reception; structure for transferring contents of an input buffer which is selected by the input pointer designated before a change of the input pointer, to an input buffer designated as a result of the change of the input pointer; and structure for changing an output pointer for managing an output of the input buffers, onto the input buffer designated after the change of the input pointer, wherein for each print mode, the position and size of the input buffer can be set arbitrarily and in real time.
Furthermore, at least one of the plurality of input buffers is set to have a size in the unit of 1 byte or 256 bytes, so that a reception buffer used in the character mode can be used for another purpose as it is. When the buffer is used as a print buffer, for example, the printout of a bit image can be further accelerated. Moreover, at least one of the plurality of input buffers is configured so as to be incorporated into a detachable cartridge.
All of the above-described prior arts have an object of providing an economical printer in which the position and size of an input buffer are changed whenever necessary and in real time to an optimum state in accordance with the feature of each mode, thereby improving the throughput.
Conventionally, a system is known in which the plurality of electronic cash registers (ECRs) or POS terminals (hereinafter, ECRs and POS terminals are generally referred to as HOSTs) share a single terminal printer via a network.
In the food dispensing business such as restaurants for example, a printer for a kitchen (a so-called kitchen printer) is used so that print data indicative of order information inputted from a plurality of order terminals are printed out by the printer disposed in the kitchen.
Such a terminal printer uses a print record sheet in the form of roll paper or sprocket paper. When the terminal printer receives a series of packetized print data transmitted from the plurality of order terminals (host devices), a series of print data requested by the same order terminal must be outputted in a single continuous region of a print record sheet. In other words, the terminal printer must be controlled so that print contents from the plurality of order terminals are not mixedly outputted. Hereinafter, a series of packetized print data are referred to as transmission data. Namely, the transmission data are configured by one or more packets. Each packet is configured by data relating to the control of the packet, and a part of print data.
FIG. 22 is an external view of such a terminal printer. The terminal printer is connected to host devices (HOSTs) via an interface 9. An inspection window 12 for journal record sheets, and an ejection port 11 for a receipt record sheet are disposed on a main body of the printer. The printer further comprises switches 13 for a sheet feed and an online/offline control, and a display device 14 which displays the error state and the online/offline state. Depending on the use of the terminal printer, one of the journal record sheets may be omitted.
FIG. 23 is a block diagram showing the electrical configuration of the terminal printer. The terminal printer comprises: a central processing unit (CPU) 1 which controls the operation of the printer; a communication control unit 2 which transmits and receives print data and commands via the interface 9 to the HOSTS; a ROM 3 which stores programs for controlling the printer and a character generator; a RAM 4 which is used as a reception buffer or a work area for the CPU 1; an input/output device 8 which comprises a display device, switches, a buzzer, and the like; an input/output control unit 5 which controls the input/output device 8; a print mechanism 7 which comprises a print head and a sheet feeder; and a print mechanism control unit 6 which controls the print mechanism 7. The input/output device 8 is indicated so as to collectively represent all input/output devices other than the print mechanism 7, including a display device such as an LED display device or an LCD display device, a buzzer, various setting switches, and operation keys. Similarly, the input/output control unit 5 is indicated so as to collectively represent all input/output control units for controlling the input/output device 8 other than the print mechanism 7. The communication control unit 2, the ROM 3, the RAM 4, the input/output control unit 5, and the print mechanism control unit 6 are respectively connected to the CPU 1 via a bus 10 and configured so that control information is transmitted among the respective blocks directly or by way of the CPU 1.
In the above configuration, print data transmitted from the HOSTs are received via the interface 9 and then sequentially stored into a reception buffer memory disposed in the RAM 4.
In accordance with a data analysis program stored in the ROM 3, partial data of the print data is sequentially fetched from a packet in the reception buffer memory and then classified into character data, print control commands, etc. Thereafter, bit map information of the print image, which is prepared on the basis of the character data and print control commands, is transmitted to a print line buffer disposed in a specific region of the RAM 4.
A print image in the print line buffer is expanded into, for example, a print start command and a specified bit map conforming to the width of a record sheet, and then sent to the print mechanism 7 via the print mechanism control unit 6. Thereafter, a print operation is executed.
FIG. 24 shows an example in which such prior art terminal printers 26 and 27 are connected to HOSTs 21 to 25 via the interface 9. In the example, the five HOSTs 21 to 25 and the two terminal printers 26 and 27 are connected to each other through the interface 9. When data are printed out simply in the reception sequence of packets, print data from different HOSTs mixedly exist in a series of print outputs because the plurality of HOSTs 21 to 25 are connected on a single network as shown in FIG. 24. Such a case where data of different HOSTs mixedly exist will be described below with reference to FIGS. 25 to 28.
FIG. 25 is a timing chart of a case where the HOSTs 21 and 22 request the print outputs shown in FIGS. 26 and 27, respectively.
In the example shown in FIG. 25, the HOST 21 transmits at time t1 a portion indicative of a print block A1 in first print data and shown in FIG. 26 as one packet AA1, and at time t3 a portion indicative of a print block A2 in the first print data as one packet AA2. On the other hand, the HOST 22 transmits at time t2 a portion indicative of a print block B1 in second print data and shown in FIG. 27 as one packet BB1, and at time t4 a portion indicative of a print block B2 in the second print data as one packet BB2.
When the packets which are transmitted in these timings are received by, for example, the terminal printer 26 in the reception sequence, and the contents of the reception buffer memory are sequentially printed, a print output in which the print blocks A1, B1, A2, and B2 are arranged in this sequence as shown in FIG. 28 is obtained. In other words, the printout is conducted in the sequence of the packet AA1, the packet BB1, the packet AA2, and the packet BB2.
In the prior art terminal printers 26 and 27, in order to solve the problem, means for identifying the station number of the HOST of packets the reception of which is once started is disposed, and transmission from another HOST is not received until transmission of the series of packets is completed.
FIG. 29 shows an example of a packet configuration which is required for such a control.
In the case where terminal printers are connected via a network, usually, a packet configuring transmission data is formed by a frame which includes information for controlling the physical layer of the network, in the top region of the packet. In the example, information for controlling the physical layer of the network is omitted. Specifically, a portion shown in FIG. 29 indicates an information region in which a region in the frame configuring the packet and corresponding to a data portion is previously signified among the HOSTs and the terminal printers, and bit serial information in the packet is shown being partitioned in the unit of a field. Hereinafter, the fields are abbreviated as P1 to P4 in the sequence starting from the top, respectively.
P1 is a field wherein a terminal address of address information of the network allocated to a terminal HOST is stored. Hereinafter, a terminal address is referred to as HA. P2 is a field wherein a last packet flag is stored. The last packet flag indicates whether or not the packet is the end of a series of packets in which a packet from another HOST should not exist, or whether or not the packet is the last packet which is lastly transmitted among the plurality of packets constituting one set of print data. Hereinafter, the last packet flag is referred to as LF. P3 is a field indicating a serial number of the packet which is assigned to each of the series of packets in the sequence starting from the top. Hereinafter, the serial number of a packet is referred to as PN. Usually, the PN is used for preventing duplicated reception of the same packet and omission of a packet from occurring. P4 is a field containing print control commands and character data which are to be actually supplied to the terminal printer. Hereinafter, print commands and data are collectively referred to as DATA.
FIG. 30 is a flowchart showing reception of print data in the prior art terminal printer having the above packet configuration. In FIG. 30, "INRX" is a flag indicating that a packet is currently received, "LHA" is storage for storing an HA in a received packet, and "LPN" is storage for storing a PN in the received packet.
Under the state of waiting for reception of a packet (step S101), it is judged whether reception of one packet is completed or not (step S102). When a packet is received, the operation proceeds to step S103. In step S103, it is judged whether or not a series of packets consisting of the plurality of packets, i.e., transmission data are currently received. When a series of packets are currently received, i.e., INRX=1, the operation proceeds to step S104 in which it is judged whether or not the terminal address (HA) is identical with the HA of the previously received packet, or whether or not the HA of the packet that has been normally received in the previous processing of the flowchart.
When it is judged in step S104 that the terminal address of the HOST is not identical with that of the previously received packet, the operation proceeds to step S108 to transmit to the HOST a negative acknowledge packet indicating that the packet has not been normally received.
By contrast, when it is Judged in step S104 that the terminal address of the HOST is identical with that of the previously received packet, the operation proceeds to step S105 and it is checked whether the received packet number is the subsequent serial number or not. When the serial number (PN) is not larger than the previous serial number (PN) by 1, the operation proceeds to step S108 to transmit to the HOST the negative acknowledge packet indicating that the packet has not been normally received. By contrast, if the serial number (PN) is larger than the serial number (PN) of the previously received packet by 1, it is assumed that the packet reception sequence is normally maintained, and the operation proceeds to step S106. It is checked whether or not the empty area of the reception buffer memory is sufficient for storing the packet which is received at this time. Thereafter, the operation proceeds to step S107 in which a positive acknowledge packet is sent to the HOST, and then to step S109 to copy the data P4 shown in FIG. 29 to the reception buffer memory.
Thereafter, the operation proceeds to step S110 to judge whether the packet is the last packet or not. When the packet is the last packet [LF=1], the operation proceeds to step S111. The INRX and the LPN are initialized and the operation then returns to step S101 to wait for reception of a packet. When it is judged in step S110 that a series of packets are currently received [LF=0], the operation proceeds to step S112. The INRX is set to be 1, the HA is stored into the LHA, and the PN is stored into the LPN. Thereafter, the operation returns to step S101 to wait for reception of a packet.
As described above, control in the prior art is conducted so that, during a period of LF=0 (the packet is not the last packet), when the HA is not a value which is currently received, a negative acknowledge is returned to the HOST and reception of the packet is disabled, thereby preventing erroneous mixture of the packet from occurring.
The packet configuration of the prior art has the following problem. After one of the HOSTs once starts the packet transmission, even when another HOST wishes to transmit print data in a period between a packet and the subsequent packet, any reception is rejected by a negative acknowledge packet or a so-called busy acknowledge. As a result, even when an idle time exists between packets, data transmission must wait until the current transmission of print data of the one HOST is completed. Therefore, this causes the throughput to be extremely impaired.
In a printer disclosed in Japanese Unexamined Patent Publication JP-A 3-26582 (1991), in order to manage and separately accumulate print data and printout results of the data for each requester of data transmitter, print data are stored into a data buffer for each internal management number which is assigned at the beginning of the communication in correspondence with the requester identifying number. When print data for one page are completed, the print data are sent together with the corresponding internal management number to a print control unit. This prior art does not describe the configuration of the data buffer for storing print data into the data buffer for each requester or each HOST, and the procedure of storing the print data into the data buffer.
Furthermore, in the prior art, since the packet reception is conducted while only the HA of a HOST is identified, there arises the following problem in the case of HOSTs having a function of multitask processing. Even when print requests are issued from the same HOST, during a period when one task processing executes a print process, another task cannot execute a print output until the print process of the task executing the print process is completed. As a result, the multitask function of the HOSTs cannot be sufficiently performed.
Other prior arts include a printer disclosed in Japanese Unexamined Patent Publication JP-A 3-30978 (1991), a wireless printer disclosed in Japanese Unexamined Patent Publication JP-A 5-309912 (1993), and a printer buffer disclosed in Japanese Unexamined Patent Publication JP-A 7-13719 (1995).
In the printer disclosed in JP-A-3-30978, respective hosts are connected to a selector of the printer via individual interface cables, the selector sequentially selects the respective cables one by one, and the selected cable is connected to an interface circuit of the printer. Each time when data for one page are received from the host, the cable is changed to another one. Therefore, in place of the interface cables, an interface which is configured by a single line and to be connected to the plurality of hosts may be connected to the selector. In this case, even when the selector selects the interface, the host is not restricted to a single one. Therefore, it is difficult to receive data from the respective hosts simultaneously.
In the wireless printer disclosed in JP-A 5-309912, priorities are previously allocated to the plurality of personal computers serving as transmitters of data, respectively. A case where, during a period when data from one of the plurality of personal computers are received and printed by wireless communication, data from another one of the personal computers are received will be considered. When the other personal computer has a higher priority than that of the one personal computer, the reception and printing of the data from the one personal computer are interrupted, and the reception and printing of the data from the other personal computer are conducted. When the other personal computer has a lower priority than that of the one personal computer, the data from the other personal computer are not received. In this case, therefore, the reception and printing of the data from the one personal computer, or those of the data from the other personal computer are stopped, with the result that the concurrent reception of data is not conducted.
In the printer buffer disclosed in JP-A 7-13719, one or more transmitting terminals and one or more receiving terminals are interposed between the plurality of personal computers and the plurality of printers, and data which are to be sent from the personal computers to the printers are transmitted by wireless communication. The terminals are assigned addresses, respectively. In accordance with the address, identification of the terminal from which data are transmitted, and that of the terminal which receives the data are displayed. Since the receiving terminal always receives data transmitted from one transmitting terminal, the concurrent reception of data is not conducted.
As shown above, the wireless printer and the printer buffer are configured without consideration of the concurrent reception of data, and therefore, when data are received simultaneously by using them, packets are erroneously mixed with each other.
Usually, a HOST edits a series of print data and then sends the edited print data, and therefore, the total amount of print data can be calculated before the transmission of the print data is started. However, since a terminal printer is not provided with a function of reserving a reception buffer memory, there arises a problem in that a buffer full condition may be recognized after sequential transmission is executed. This problem causes a network to be wasted, thereby lowering the efficiency of the network.
At a timing when a terminal printer returns a positive acknowledge after normally receiving packets, the operation of a HOST is transferred to the next processing under the assumption that the printing is normally ended. Actually, however, there are cases such as print sheets are exhausted while the terminal printer executes the printing, and the printout is disabled because of a breakdown of a print mechanism. In such cases, the printout is not conducted until the operator of the HOST is aware of the situation, or the print data cannot be outputted until the printer is repaired. In the worst case, the print data may be lost.
Since simultaneous reception of print data from the plurality of HOSTs is not allowed conventionally, even when the printout processing is started from the top portion of the reception buffer in the unit of a packet, there arises no problem. When a terminal printer which is configured so that simultaneous reception of print data from the plurality of HOSTs is allowed, the following problem is occurred. When, before reception of a series of print data consisting of one or more packets is completed, the printing of a packet received from the next HOST is started, the arrival of the print data may be delayed because of low throughput of the HOSTs or transient increase of traffic in the network, with the result that the printout for another HOST must wait.
When a terminal printer is used as a kitchen printer or the like, there arises a problem in that the printout cannot be conducted in the sequence of orders.